<template>
  <div class="home">
    <div class="container">
      <div class="count">访问统计：{{ number }}</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import axios from "axios";
import { onMounted, ref } from "vue";

const number = ref('0');

onMounted(() => {
  axios.get("/server/read").then((res) => {
    number.value = res.data.content;
  }).catch((err) => {
    console.log(err)
    number.value = '请检查服务是否正常启动'
  });
});
</script>

<style lang="scss">
.count {
  font-size: 20px;
  padding: 10px;
}
</style>
